Skip to content

ci: add a check for the target branch on PRs#1672

Draft
MyPyDavid wants to merge 1 commit into
2.5.2/releasefrom
2.5.2/ci/add-check-pr-target-branch
Draft

ci: add a check for the target branch on PRs#1672
MyPyDavid wants to merge 1 commit into
2.5.2/releasefrom
2.5.2/ci/add-check-pr-target-branch

Conversation

@MyPyDavid

@MyPyDavid MyPyDavid commented Jul 10, 2026

Copy link
Copy Markdown
Member

Description

When I tried to target this PR to main it failed and showed:

Run echo "Source branch: ${SOURCE_BRANCH}"
Source branch: 2.5.2/ci/add-check-pr-target-branch
Target branch: main
Warning: Branch '2.5.2/ci/add-check-pr-target-branch' targets 'main'. Only '<x.y.z>/release' branches are expected to target 'main'. Feature and fix branches should target their matching release branch instead, for example '2.5.2/release'.
Error: Process completed with exit code 1.

Motivation and Context

Maybe it can help in preventing accidentally wrong merges, without cluttering the CI too much..

This would prevent targeting a non-release branch to main accidentally.

Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
@MyPyDavid
MyPyDavid changed the base branch from main to 2.5.2/release July 10, 2026 13:22
@MyPyDavid MyPyDavid self-assigned this Jul 10, 2026
@MyPyDavid MyPyDavid added type:maintenance github_actions Pull requests that update GitHub Actions code labels Jul 10, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 95.118%2.5.2/ci/add-check-pr-target-branch into 2.5.2/release. No base build found for 2.5.2/release.

@jochenklar

Copy link
Copy Markdown
Member

Good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code type:maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants